function clicked(input) {
    calender.textInput = input
    calender.open()
}

function finished () {
     calender.textInput.text = Qt.formatDate(calender.selectedDate, "yyyy-MM-dd")
    nav.initializeTask(0,2, "正在添加")
    http.put("/examp.json", {id: usinfo.id}, {
                examp: [tf1.text, tf2.text, tf3.text, tf4.text]
                  }, result)

   nav.value++
}

function result(json) {
    nav.value = nav.maximumValue
    if (json.error) {
         calender.textInput.text = ""
        dialog.toast(json.error.description)
        return
    }
}

function query() {
        delayRun(500, null, function(){
            http.get("/examp.json?t=q", {id: usinfo.id}, queryResult)
        })
}

function queryResult(json) {
    if (json.error) {
        dialog.toast(json.error.description)
    }
    tf1.text = json.examp[0]
    tf2.text = json.examp[1]
    tf3.text = json.examp[2]
    tf4.text = json.examp[3]
}
